#@embedLayout()


#define content()

<form id="formId" method="post">
    <input type="hidden" name="uasConfig.config_id" id="configId" value="#(uasConfig.configId??)">
    <table class="table table-bordered">
        <tr>
            <td style="padding-top:15px;">中文名称:</td>
            <td><input type="text" id="configCname" name="uasConfig.config_cname"
                       value="#(uasConfig.config_cname??)" style="width: 95%;" #if(uasConfig !=null) readonly="readonly"
                       #end>
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">英文名称:</td>
            <td>
                <input type="text" class="easyui-textbox" id="configEname" name="uasConfig.config_ename"
                       value="#(uasConfig.config_ename??)" style="width:98%;">
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">配置类型:</td>
            <td>
                <select name="uasConfig.config_type" id="configType" style="width:98%;" class="easyui-combobox" data-options="editable:false">
                    <option #if(uasConfig.config_type?? == 1) selected #end value="1">系统配置</option>
                    <option #if(uasConfig.config_type?? == 2) selected #end value="2">缓存配置</option>
                </select>
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">内容:</td>
            <td>
                <input type="text" class="easyui-textbox" id="configValue" name="uasConfig.config_value"
                       value='#(uasConfig.config_value??)' style="width:98%;">
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">是否显示:</td>
            <td>
                <select name="uasConfig.config_user_defined" id="configUserDefined" style="width:98%;"
                        class="easyui-combobox" data-options="editable:false">
                    <option #if(uasConfig.config_user_defined?? == 1) selected #end value="1">显示</option>
                    <option #if(uasConfig.config_user_defined?? == 0) selected #end value="0">隐藏</option>
                </select>
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">默认值:</td>
            <td>
                <input type="text" class="easyui-textbox" id="configDefaultValue" name="uasConfig.config_default_value"
                       value='#(uasConfig.config_default_value??)' style="width:98%;">
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">数据类型:</td>
            <td>
                <select name="uasConfig.data_type" id="dataType" style="width:98%;"
                        class="easyui-combobox" data-options="editable:false">
                    <option #if(uasConfig.data_type?? == 'string') selected #end>string</option>
                    <option #if(uasConfig.data_type?? == 'number') selected #end>number</option>
                    <option #if(uasConfig.data_type?? == 'boolean') selected #end>boolean</option>
                    <option #if(uasConfig.data_type?? == 'json') selected #end>json</option>
                </select>
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">正则表达式:</td>
            <td>
                <input type="text" class="easyui-textbox" id="regex" name="uasConfig.regex" value="#(uasConfig.regex??)"
                       style="width:98%;">
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">错误信息:</td>
            <td>
                <input type="text" class="easyui-textbox" id="errorMsg" name="uasConfig.error_msg"
                       value="#(uasConfig.error_msg??)" style="width:98%;">
            </td>
        </tr>
        <tr>
            <td style="padding-top:15px;">排序:</td>
            <td>
                <input type="text" class="easyui-numberbox" id="orderNumber" name="uasConfig.order_number"
                       value="#(uasConfig.order_number??)" style="width:98%;">
            </td>
        </tr>
    </table>
</form>

#end


#define css()


#end


#define js()

<script type="text/javascript">
    function datagrid_save(opr_type) {
        var url = '';
        if (opr_type == 'add') {
            url = contextRootPath + '/uasConfig/save';
        } else {
            url = contextRootPath + '/uasConfig/datagridUpdate';
        }

        $('#formId').form('submit', {
            url: url,
            onSubmit: function () {
                var flag = $(this).form('enableValidation').form('validate');
                if (flag) {
                    showProcess(true, '温馨提示', '正在提交数据...');
                }
                return flag;
            },
            success: function (data) {
                showProcess(false);
                var params = {};
                params.element = _datagrid;
                params.data = data;
                resultCallback(params);
            },
            onLoadError: function () {
                showProcess(false);
                $.messager.alert('温馨提示', '由于网络或服务器太忙，提交失败，请重试！');
            }
        });
    }

</script>

#end


